package Menu;

import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.*;
import javax.swing.*;

public class FoodList
{
    FoodList()
    {
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JButton button = new JButton("Place Order");
        frame.setLayout(new BorderLayout());
        frame.add(button, BorderLayout.CENTER);
        ///button.setBounds(120, 700, 150, 40);

        //New code
        JPanel panelRight = new JPanel();
        JPanel panelLeft = new JPanel();
        GridLayout gridRight = new GridLayout(1, 2);
        GridLayout gridLeft = new GridLayout(1, 2);

        panelRight.setLayout(gridRight);
        panelLeft.setLayout(gridLeft);
        JButton buttonFood1 = new JButton("Apple");
        
        JButton buttonFood2 = new JButton("Pear");
        JButton buttonFood3 = new JButton("Brains");
        panelRight.add(buttonFood1);
        panelRight.add(buttonFood2);
        panelRight.add(buttonFood3);

        JButton buttonFood4 = new JButton("Yogurt");
        JButton buttonFood5 = new JButton("Ice Cream");
        JButton buttonFood6 = new JButton("Candy");
        panelLeft.add(buttonFood4);
        panelLeft.add(buttonFood5);
        panelLeft.add(buttonFood6);
        frame.add(panelRight, BorderLayout.SOUTH);
        frame.add(panelLeft, BorderLayout.NORTH);

        ///frame.pack();
        //end new code

        frame.setSize(400, 800);
        frame.setVisible(true);
        button.addActionListener(new ActionListener()
        {
            @Override
            public void actionPerformed(ActionEvent e)
            {
                JFrame frame = new JFrame();
                frame.add(new JLabel("Thank you! Your Order has been placed."));
                frame.setVisible(true);
                frame.setSize(300, 100);
            }
        });
    }

    public static void main(String[] args)
    {
        new FoodList();
    }
}
